import { Guard } from '../../constants/guard';

export default [
  {
    path: '/redirect/:path(.*)',
    component: () => import('../../views/redirect/index')
  },
  {
    path: '/',
    name: 'home',
    redirect: '/area/list'
  },
  {
    path: '/factory',
    name: 'factory',
    meta: {
      title: '区域管理',
      svg: 'factory',
      layout: true,
      guardList: [Guard.FactoryView, Guard.FactoryManage, Guard.AreaView, Guard.AreaManage]
    },
    redirect: '/factory/list'
  },
  {
    path: '/area/list',
    name: 'areaList',
    meta: {
      title: '区域列表',
      svg: 'area',
      layout: true,
      parentMenu: 'factory',
      guardList: [Guard.AreaView, Guard.AreaManage]
    },
    component: () => import('../../views/area/list/index.vue')
  },
  {
    path: '/factory/list',
    name: 'factoryList',
    meta: {
      title: '工厂列表',
      svg: 'factory-l2',
      layout: true,
      parentMenu: 'factory',
      guardList: [Guard.FactoryView, Guard.FactoryManage]
    },
    component: () => import('../../views/factory/list/index.vue')
  },
  {
    path: '/factory/create',
    name: 'factoryCreate',
    meta: {
      title: '添加工厂',
      svg: 'factory',
      layout: true,
      hidden: true,
      parentMenu: 'factory',
      guardList: [Guard.FactoryManage]
    },
    component: () => import('../../views/factory/create/index.vue')
  },
  {
    path: '/factory/edit/:uuid',
    name: 'factoryEdit',
    meta: {
      title: '更新工厂',
      svg: 'factory',
      layout: true,
      hidden: true,
      parentMenu: 'factory',
      guardList: [Guard.FactoryManage]
    },
    component: () => import('../../views/factory/edit/index.vue')
  }
];
